package com.easyfun.healthmagicbox.base;

import android.content.Context;

import com.easyfun.healthmagicbox.ormlite.DatabaseHelper;
import com.j256.ormlite.android.apptools.OpenHelperManager;

public class DatabaseAccessImplementation implements DatabaseAccess{

	private static DatabaseAccessImplementation instance = new DatabaseAccessImplementation();
	
	DatabaseHelper databaseHelper;
	/**
	 * You'll need this in your class to get the helper from the manager once per class.
	 */
	public DatabaseHelper getHelper(Context context) {
		if (databaseHelper == null) {
			databaseHelper = OpenHelperManager.getHelper(context, DatabaseHelper.class);
		}
		return databaseHelper;
	}
	
	private DatabaseAccessImplementation()
	{
		
	}
	
	public static DatabaseAccessImplementation getInstance()
	{
		return instance;
	}
}
